<?php defined('BASEPATH') OR exit('No direct script access allowed');

class System_library
{
	public $settings = array();
	
	public function __construct()
	{
		if (!isset($this->CI))
		{
			$this->ci =& get_instance();
		}
		
		$this->ci->load->model('Settings_lib_m');
		$this->get_default_setting();
	}
	
	public function get_default_setting()
	{
		$s = new Settings_lib_m();
		
		$s->select('slug, default');
		$s->where('is_active', '1');
		$s->get();
		
		if ($s->result_count() > 0)
		{
			foreach ($s as $row)
			{
				$this->settings[$row->slug] = $row->default;
			}
		}
	}
}